package at.kaok.betfair.valueobjects;

import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.Entity;

public class MarketPrice {

	int marketId;
	double priceLay1;
	double priceBack1;
	double priceLay2;
	double priceBack2;
	double priceLayX;
	double priceBackX;
	
	public MarketPrice(int marketId) {
		this.marketId = marketId;
	}
	public double getPriceLay1() {
		return priceLay1;
	}
	public void setPriceLay1(double priceLay1) {
		this.priceLay1 = priceLay1;
	}
	public double getPriceBack1() {
		return priceBack1;
	}
	public void setPriceBack1(double priceBack1) {
		this.priceBack1 = priceBack1;
	}
	public double getPriceLay2() {
		return priceLay2;
	}
	public void setPriceLay2(double priceLay2) {
		this.priceLay2 = priceLay2;
	}
	public double getPriceBack2() {
		return priceBack2;
	}
	public void setPriceBack2(double priceBack2) {
		this.priceBack2 = priceBack2;
	}
	public double getPriceLayX() {
		return priceLayX;
	}
	public void setPriceLayX(double priceLayX) {
		this.priceLayX = priceLayX;
	}
	public double getPriceBackX() {
		return priceBackX;
	}
	public void setPriceBackX(double priceBackX) {
		this.priceBackX = priceBackX;
	}
	
	public void save(){
		
		DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();

		Entity maPrice = new Entity("MarketPrice");
		maPrice.setProperty("marketId", marketId);
		maPrice.setProperty("priceLay1", priceLay1);
		maPrice.setProperty("priceLay2", priceLay2);
		maPrice.setProperty("priceLayX", priceLayX);
		maPrice.setProperty("priceBack1", priceBack1);
		maPrice.setProperty("priceBack2", priceBack2);
		maPrice.setProperty("priceBackX", priceBackX);

		datastore.put(maPrice);
	}
	
	
}
